package com.xbongbong.pro.enums.lowcode;

import com.xbongbong.paas.enums.FieldTypeEnum;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * @author 吴峰
 * @date 2021/03/04 15:49
 */
@Getter
public enum FieldLowCodeActionEnum {

    /**
     *
     */
    TEXT(FieldTypeEnum.TEXT.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),


    NUM(FieldTypeEnum.NUM.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    COMBO(FieldTypeEnum.COMBO.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    DATETIME(FieldTypeEnum.DATETIME.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    IMAGE(FieldTypeEnum.IMAGE.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    TEXTAREA(FieldTypeEnum.TEXTAREA.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    UPLOAD(FieldTypeEnum.UPLOAD.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    STAR(FieldTypeEnum.STAR.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    ADDRESS(FieldTypeEnum.ADDRESS.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),


    BIRTHDAY(FieldTypeEnum.BIRTHDAY.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    RADIO_GROUP(FieldTypeEnum.RADIO_GROUP.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    COMBO_CHECK(FieldTypeEnum.COMBO_CHECK.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    CHECKBOX_GROUP(FieldTypeEnum.CHECKBOX_GROUP.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    LOCATION(FieldTypeEnum.LOCATION.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    LINK_DATA(FieldTypeEnum.LINK_DATA.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),

    USER(FieldTypeEnum.USER.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    USER_GROUP(FieldTypeEnum.USER_GROUP.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    DEPT(FieldTypeEnum.DEPT.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    DEPT_GROUP(FieldTypeEnum.DEPT_GROUP.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    DEPARTMENTID(FieldTypeEnum.DEPARTMENTID.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    OWNERID(FieldTypeEnum.OWNERID.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE, LowCodeActionEnum.TEAM_CHANGES)),
    COUSERID(FieldTypeEnum.COUSERID.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE, LowCodeActionEnum.TEAM_CHANGES)),
    SERIALNO(FieldTypeEnum.SERIALNO.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    /**
     * 子表单和关联产品
     */
    SUB_FORM(FieldTypeEnum.SUB_FORM.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE, LowCodeActionEnum.ON_ADDROW, LowCodeActionEnum.ON_DELETEROW, LowCodeActionEnum.ON_COPYROW)),
    SELECT_PRODUCT(FieldTypeEnum.SELECT_PRODUCT.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),

    LINK_BUSINESS_SINGLE(FieldTypeEnum.LINK_BUSINESS_SINGLE.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    /**
     * 关联数据多选
     */
    LINK_DATA_MULTI(FieldTypeEnum.LINK_DATA_MULTI.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE)),
    // 阶段推进器
    STAGE_THRUSTER(FieldTypeEnum.STAGE_THRUSTER.getType(), "field", Arrays.asList(LowCodeActionEnum.ON_CHANGE, LowCodeActionEnum.BEFORE_STAGE_CHANGE, LowCodeActionEnum.AFTER_STAGE_CHANGE)),

    FORM(null, "form", Arrays.asList(LowCodeActionEnum.ON_FROM_MOUNTED, LowCodeActionEnum.BEFORE_FROM_SUBMIT, LowCodeActionEnum.AFTER_FROM_SUBMIT, LowCodeActionEnum.LIST_BUTTON, LowCodeActionEnum.DETAIL_BUTTON, LowCodeActionEnum.APPROVE_BUTTON, LowCodeActionEnum.ON_LIST_FIELD_EDIT))

    ;

    private Integer type;

    /**
     * 属于 filed：字段； form：表单
     */
    private String belong;

    private List<LowCodeActionEnum> actionList;



    FieldLowCodeActionEnum(Integer type, String belong, List<LowCodeActionEnum> actionList) {
        this.type = type;
        this.belong = belong;
        this.actionList = actionList;
    }
}
